const Sequelize = require('sequelize');
module.exports = function (sequelize) {
  return sequelize.define(
    "goods",  // 表名
    {
      isVerified: {  // 是否所否身份认证
        type: Sequelize.BOOLEAN,
        allowNull: false,
        default: true
      },
      verifyNum: {  // 认证编号
        type: Sequelize.BIGINT(11),
        allowNull: false,
      },
      imagePath: {  // 图片路径
        type: Sequelize.STRING(255),
        allowNull: true,
      },
      goodsTitle: {  // 商品标题
        type: Sequelize.STRING(20),
        allowNull: false,
      },
      goodsClass: {  // 商品类别
        type: Sequelize.STRING(20),
        allowNull: true,
      },
      goodsDescription: {  // 商品描述
        type: Sequelize.TEXT(0),
        allowNull: false,
      },
      price: {  // 商品价格
        type: Sequelize.INTEGER(8),
        allowNull: false,
      },
      isSold: {  // 商品是否卖出
        type: Sequelize.BOOLEAN,
        allowNull: false,
        default: false
      },
      soldTime: {  // 商品是否卖出
        type: Sequelize.DATE,
        allowNull: true,
      }
    }
  )
};